﻿#include <iostream>
#include <vector>
using namespace std;

class Solution
{
public:
    // 334. 递增的三元子序列
    bool increasingTriplet(vector<int>& nums)
    {
        int first = nums[0], second = INT_MAX;
        for (int i = 1; i < nums.size(); ++i)
        {
            if (nums[i] > second)
                return true;
            else if (nums[i] > first)
                second = nums[i];
            else
                first = nums[i];
        }
        return false;
    }

    // 674. 最长连续递增序列
    int findLengthOfLCIS(vector<int>& nums)
    {
        int ret = 0, n = nums.size();
        for (int i = 0; i < n;)
        {
            int j = i + 1;
            while (j<n && nums[j]>nums[j - 1])
                ++j;
            ret = max(ret, j - i);
            i = j;
        }
        return ret;
    }
};

int main()
{
    /*vector<int> v{ 6,7,1,2 };
    cout << Solution().increasingTriplet(v) << endl;*/

    vector<int> v{ 1,3,5,4,7 };
    cout << Solution().findLengthOfLCIS(v) << endl;

    return 0;
}